package com.alpesressources.comexpert.util;

import java.util.HashMap;
import org.apache.log4j.Logger;

public class QueryStringParser {
	private static Logger logger = Logger.getLogger(QueryStringParser.class);
	
	public static HashMap<String, Object> parse(String queryString) {
		HashMap<String, Object> m = new HashMap<String, Object>();

		if (queryString != null) {
			String params[] = queryString.split("&");
			for (String p : params) {
				logger.debug(p);
				String t[] = p.split("=");
			
				if(t.length == 2) {
					m.put(t[0], t[1]);
				}
			}
		}

		return m;
	}
}
